<template>
    <div class="box">
        <div class="title">
            <p>年度游客量对比</p>
            <img src="@/assets/screen/dataScreen-title.png" alt="">
        </div>
        <div class="charts" ref="chart"></div>
    </div>
</template>

<script setup lang='ts'>
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'

const chart = ref()

onMounted(() => {
    const mycharts = echarts.init(chart.value)
    mycharts.setOption({
        xAxis: { type: 'category' },
        yAxis: {
            splitLine: {
                show: false
            },
        },
        grid: {
            left: 20,
            top: 20,
            right: 0,
            bottom: 20
        },
        series: {
            type: 'scatter',
            data: [120, 2240, 4402, 1210, 4212, 4623, 2326, 3221, 3424, 1234, 3210, 414, 6245, 3161, 4623, 414, 6245, 3161, 4623, 2326,],
        },
        label:{
            show:true,
            position:'top',
            color:'skyblue'
        }
    })
})
</script>

<style scoped lang="scss">
.box {
    width: 100%;
    height: 100%;
    background: url(@/assets/screen/dataScreen-main-cb.png) no-repeat;
    background-size: 100% 100%;
    margin-top: 20px;

    .title {
        p {
            color: white;
            font-size: 15px
        }
    }

    .charts {
        height: calc(100% - 30px);
    }
}
</style>